# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
{% if elk_tls_enabled %}
{% if elk_version is version("8", ">=") %}
    ssl_enabled => true
    ssl_verification_mode => "none"
{% else %}
    ssl => true
    ssl_certificate_verification => false
{% endif %}
{% endif %}
    user => "elastic"
    password => "{{ es_builtin_users.elastic }}"
    hosts => [
{% for ip in es_master_ips %}
      "{{ elk_schema }}{{ ip }}:9200"{{ (loop.nextitem is defined) | ternary(',', '') }}
{% endfor %}
    ]
    index => "sample-%{+YYYY.MM.dd}"
  }
}
